package com.queming.music.entity;

import com.queming.core.entity.AbstractEntity;
import com.queming.core.entity.File;
import com.queming.music.enums.MusicStatus;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * @author chencidiao
 * @date 2022/05/03 15:24
 **/
@Entity
@Data
public class Music extends AbstractEntity {
    private String name;


    @Enumerated(EnumType.STRING)
    private MusicStatus status;

    @ManyToMany
    @JoinTable(name = "artist_music",joinColumns = @JoinColumn(name = "music_id",referencedColumnName = "id"),
              inverseJoinColumns = @JoinColumn(name = "artist_id",referencedColumnName = "id"))
    private List<Artist> artistList;

    private String description;

    @OneToOne
    private File file;
}
